put ScrollBar(false, true, true, 0, Range, thumb, Page) into thumb
lock screen
set the scroll of cd fld "Scroll1" to thumb * Scale1
set the scroll of cd fld "Scroll2" to thumb * Scale2
set the scroll of cd fld "Scroll3" to thumb * Scale3
unlock screen
end mouseEnter
on trackScroll
global ScrollValue, Scale1, Scale2, Scale3
lock screen
set the scroll of cd fld "Scroll1" to ScrollValue * Scale1
set the scroll of cd fld "Scroll2" to ScrollValue * Scale2
set the scroll of cd fld "Scroll3" to ScrollValue * Scale3
unlock screen
end trackScroll
on initBar
global Scale1, Scale2, Scale3, Range, Page
lock screen
put the textHeight of cd fld "Scroll1" into Scale1
put the textHeight of cd fld "Scroll2" into Scale2
put the textHeight of cd fld "Scroll3" into Scale3
set the scroll of cd fld "Scroll1" to 0
set the scroll of cd fld "Scroll2" to 0
set the scroll of cd fld "Scroll3" to 0
put the number of lines in cd fld "Scroll1" into lnum
put the height of cd fld "Scroll1" into height
put lnum - trunc(height/Scale1) into Range
put lnum - range into Page
put ScrollBar(false, true, true, 0, Range, 0, -1) into it
end initBar
-- part 7 (field)
-- low flags: 01
-- high flags: 0001
-- rect: left=17 top=250 right=271 bottom=300
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name:
-- part 8 (field)
-- low flags: 01
-- high flags: 0000
-- rect: left=308 top=116 right=270 bottom=494
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 33
-- text size: 12
-- style flags: 0
-- line height: 15
-- part name:
-- part 9 (field)
-- low flags: 81
-- high flags: 0007
-- rect: left=15 top=15 right=273 bottom=497
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 4
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name: Script
-- part contents for card part 1
----- text -----
ScrollBar() may be used to implement
multiple scrolling fields. To do this
set doCallBack to true and write a
trackScroll handler to read the
current thumb value and adjust the
scroll value of your fields. To achieve
a clean scroll lock the screen within
your trackScroll handler before
adjusting the scroll values and unlock
it again after. ScrollBar() will set
things up so that this lock/unlock will
not destroy the scroll bar picture. For
the best effect use a mouseEnter
handler to invoke ScrollBar() as this
will provide a quick response to
mouse clicks in the scroll bar.
-- part contents for card part 2
----- text -----
ScrollBar() may be used to implement multiple scrolling fields. To do this set doCallBack to true and write a trackScroll handler to read the
current thumb value and adjust the scroll value of your fields. To achieve a clean scroll lock the screen within your trackScroll handler before adjusting the scroll values and unlock it again after. ScrollBar() will set things up so that this lock/unlock will not destroy the scroll bar picture. For the best effect use a mouseEnter handler to invoke ScrollBar() as this will provide a quick response to
mouse clicks in the scroll bar.
-- part contents for card part 4
----- text -----
ScrollBar() may be used to implement multiple scrolling fields. To do this
set doCallBack to true and write a trackScroll handler to read the current thumb value and adjust the scroll value of your fields. To achieve a clean scroll lock the screen within your trackScroll handler before adjusting the scroll values and unlock it again after. ScrollBar() will set things up so that this lock/unlock will not destroy the scroll bar picture. For the best effect use a mouseEnter handler to invoke ScrollBar() as this will provide a quick response to mouse clicks in the scroll bar.
-- part contents for card part 8
----- text -----
Setting doPaint true gives the best æsthetic effect but is slowed down by the HyperCard painting, this is the cause of the delay when the mouse leaves the scroll region. Using a mouseEnter handler causes the cursor to change to an arrow while in the scroll region.
-- part contents for card part 9
----- text -----
Script of the scroll bar button:
on mouseEnter
global Scale1, Scale2, Scale3, Range, Page
put the scroll of cd fld "Scroll1" into snum
put round(snum/Scale1) into thumb
put ScrollBar(false, true, true, 0, Range, thumb, Page) into thumb
lock screen
set the scroll of cd fld "Scroll1" to thumb * Scale1
set the scroll of cd fld "Scroll2" to thumb * Scale2
set the scroll of cd fld "Scroll3" to thumb * Scale3
unlock screen
end mouseEnter
on trackScroll
global ScrollValue, Scale1, Scale2, Scale3
lock screen
set the scroll of cd fld "Scroll1" to ScrollValue * Scale1
set the scroll of cd fld "Scroll2" to ScrollValue * Scale2
set the scroll of cd fld "Scroll3" to ScrollValue * Scale3
unlock screen
end trackScroll
on initBar
global Scale1, Scale2, Scale3, Range, Page
put the textHeight of cd fld "Scroll1" into Scale1
put the textHeight of cd fld "Scroll2" into Scale2
put the textHeight of cd fld "Scroll3" into Scale3
put the number of lines in cd fld "Scroll1" into lnum
put the scroll of cd fld "Scroll1" into snum
put the height of cd fld "Scroll1" into height
put lnum - trunc(height/Scale1) into Range
put lnum - range into Page
put round(snum/Scale1) into thumb
put ScrollBar(false, true, true, 0, Range, thumb, -1) into thumb